import axios from 'axios'
import store from '@/store'

const request = axios.create({
	timeout: 10000
})

request.interceptors.request.use(config => {
	store.commit('setVisible', true)
	return config
}, error => {
	return Promise.reject(error)
})

request.interceptors.response.use(response => {
	store.commit('setVisible', false)
	return response
}, error => {
	return Promise.reject(error)
})



export default request